package com.zqh.cli.command;


import cn.hutool.core.io.FileUtil;
import com.zqh.cli.example.ASCIIArt;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import java.io.File;
import java.util.List;

@Command(name = "list",description = "查看文件列表",mixinStandardHelpOptions = true)
public class ListCommand implements Runnable {


    @Override
    public  void run() {
        // 整个路径的根目录
        String projectPath = System.getProperty("user.dir");
        // 整个目录的跟路径
        File parentPath = new File(projectPath);
        // 输入路径
        String inputPath = new File(parentPath,"zqh-generator-demo-projects/acm-template").getAbsolutePath();
        List<File> files = FileUtil.loopFiles(inputPath);

        for (File file: files) {
            System.out.println(file);

        }
    }

    public static void main(String[] args) {
        int exitCode = new CommandLine(new ListCommand()).execute(args);
        System.exit(exitCode);

    }

}
